<template>
    <div class="result-page">
        <el-result v-if="isApproved" icon="success" title="已经成功审批案件，等待签收">
            <template slot="extra">
                <el-button type="primary" size="medium" @click="goBackList">返回列表</el-button>
            </template>
        </el-result>

        <el-result v-else icon="error" title="已经成功驳回案件">

            <template slot="extra">
                <el-button type="primary" size="medium" @click="goBackList">返回列表</el-button>
            </template>
        </el-result>
    </div>
</template>

<script>
export default {
    data() {
        return {
            isApproved: true
        }
    },
    mounted() {
        console.log('query:', this.$route.query)
        this.isApproved = this.$route.query.approved == 1
    },
    methods: {
        goBackList() {
            const routeMap = {
                '1': '/case/list',
                '2': '/case/list2',
                '3': '/case/list3',
            }
            this.$router.push({ path: routeMap[this.$route.query.type] })
        }
    }
};
</script>

<style scoped>
.result-page {
    display: flex;
    justify-content: center;
    align-items: center;
}
</style>
